<?php

/**
* 这个是注册功能的模板 
*/
class ModelZhuce extends GetLoad
{
	
	public function chazhaozhucema($zhucema){

		$reluse=$this->SQLquery("SELECT * from class where zhucema='".$zhucema."'");
		if(!isset($reluse)){
			echo "您的注册码有误";
			die;
		}

		//var_dump($reluse);
		return $reluse[0]['class_id'];


	}

	public function wangchengzhuce($data){
		//	echo $data['shoujihao'];die;	

		$this->SQLcun("INSERT INTO name (name,xuanyan,huanyingyu,password,class,quanxian,touxiang,shoujihao) VALUES ('".$data['name']."','暂时没有宣言','欢迎来到我的博客','".$data['password']."','".$this->chazhaozhucema($data['zhucema'])."',3,'./img/1.jpg',".$data['shoujihao'].")");
		
				

	}
	public function jiance($name){
		$reluse=$this->SQLquery("SELECT * from name where name='".$name."'");


		if($reluse){
			return 1 ;

		}else{
			return 0 ;

		}


	}

}